package wechat

import (
	"gitee.com/ifinder/gocomm"
	"gitee.com/ifinder/wechat-ipad-sdk-golang/wechat/group"
)

//  发邀请进群 （ 适合40人以内）
func (this *WechatApi) SendInventGroup(req group.SendInventGroupReq) (*group.SendInventGroupResp,error) {

	resp:=group.SendInventGroupResp{}


	uri:=this.serviceUrl+"/718/Group/AddChatRoomMember"

	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return &resp,err

}





//  发邀请进群 （ 适合40人以上）
func (this *WechatApi) SendInventGroupMore(req group.SendInventGroupMoreReq) (*group.SendInventGroupMoreResp,error){

	resp:=group.SendInventGroupMoreResp{}



	uri:=this.serviceUrl+"/718/Group/InviteChatRoomMember"

	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return &resp,err

}




//  获取群成员资料
func (this *WechatApi) GetGroupMembers(req group.GetGroupMembersReq) (*group.GetGroupMembersResp,error) {

	resp:=group.GetGroupMembersResp{}


	uri:=this.serviceUrl+"/718/Group/GetChatRoomMemberDetail"

	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return &resp,err

}



//  创建群


func (this *WechatApi) CreateGroup(req group.CreateGroupReq) (*group.CreateGroupResp,error) {

	resp:=group.CreateGroupResp{}


	uri:=this.serviceUrl+"/718/Group/CreateChatRoom"

	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return &resp,err

}

